package com.cdm.persistence;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * CdmContentType entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "CDM_CONTENT_TYPE", catalog = "CDM", uniqueConstraints = {})
public class ContentType implements java.io.Serializable {

	// Fields

	@Id
	@Column(name = "id", unique = true, nullable = false, insertable = true, updatable = true)
	private Long id;

	@Column(name = "name", unique = false, nullable = false, insertable = true, updatable = true, length = 200)
	private String name;

	/*
	 * equals
	 */
	public boolean equals(Object other) {
		System.out.println("Call Equals : " + this.getId() + " and "
		        + ((other == null) ? "null" : ((ContentType) other).getId()));
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof ContentType))
			return false;
		ContentType castOther = (ContentType) other;

		return ((this.getId() == castOther.getId()) || (this.getId() != null && castOther.getId() != null && this
		        .getId().equals(castOther.getId())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result + (getId() == null ? 0 : this.getId().hashCode());
		result = 37 * result + (getName() == null ? 0 : this.getName().hashCode());
		return result;
	}

	// Constructors

	/** default constructor */
	public ContentType() {
	}

	/** full constructor */
	public ContentType(Long id, String name) {
		this.id = id;
		this.name = name;
	}

	// Property accessors
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

}